﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ShareIt_MVC3.Models;
using System.Diagnostics;

namespace ShareIt_MVC3.Controllers
{
    public abstract class MainController : Controller
    {
        protected UserCollection userColl = new UserCollection();
        protected ResourceCollection resColl = new ResourceCollection();
        protected LendingCollection lendColl = new LendingCollection();

        // MyUser Objekt beeinhaltet das user objekt des aktuell eingeloggten users
        public User MyUser
        {
            get { return HttpContext.User.Identity.IsAuthenticated ? userColl.GetUserByUsername(HttpContext.User.Identity.Name) : null; }
        }

    }
}
